<?php

namespace App\Entities;

use Illuminate\Database\Eloquent\Model;

class ClassEntity extends Model
{
    //
    protected $table = 's_classes';

    protected $fillable = [
        'name','course_id', 'term_id', 'start_time', 'end_time', 'start_end', 'start_day',
        'end_day', 'member_limit','saler',
    ];

    public function term() {
       return $this->belongsTo('App\Entities\Term', 'term_id');
    }

    public function course() {
        return $this->belongsTo('App\Entities\Course', 'course_id');
    }
    public function members() {
        return $this->hasMany('App\Entities\ClassMember','class_id', 'id');
    }

}
